const path = require('path')
const rules = require('./webpack/rule')

// const ExtractTextPlugin = require('extract-text-webpack-plugin')
module.exports = {
    mode: 'production',
    node: {
        setImmediate: 'empty',
        process: 'mock',
        dgram: 'empty',
        fs: 'empty',
        net: 'empty',
        tls: 'empty',
        child_process: 'empty',
        'electron-updater': 'empty',
        'serialport': 'empty'
    },
    externals: {
        autoUploader: 'electron-updater',
        SerialPort: 'serialport'
    },
    resolve: {
        extensions: ['.json', '.js', '.jsx', '.ts', '.tsx'],
        modules: ["node_modules"]
    },
    entry: {
        index: path.join(__dirname, "src/index.ts"),
    },
    devtool: 'none',
    target: 'electron-main',
    output: {
        path: path.join(__dirname, 'src'),
        filename: '[name].js',
    },
    module: {
        rules
    }
}